home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / appsrcs.zip / APPSETUP.ZIP / APPINI.C < prev    next >
C/C++ Source or Header  |  1993-06-04  |  2KB  |  68 lines

  1. #define STRICT
  2. #include <windows.h>
  3. #include <windowsx.h>
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. #include <string.h>
  7. #include "appsetup.h"
  8.  
  9. /*--------------------------------------------------------------------------*/
  10. /* FUNCTION: IniRead(void)                            */
  11. /*                                        */
  12. /* PURPOSE:  Read settings in the appbar.ini file.                */
  13. /*--------------------------------------------------------------------------*/
  14. VOID PASCAL IniRead(VOID)
  15.     {
  16.     int i;
  17.  
  18.     SetCursor(LoadCursor(NULL, IDC_WAIT));
  19.     // get ini-settings for AppSystem struct.
  20.     strcpy(AppSystem.DefaultIconDir, " ");
  21.     AppSystem = ReadSystemIni();
  22.     if(AppSystem.Border < 3)
  23.     AppSystem.Border = 0;
  24.  
  25.     // get ini-settings for AppSound struct.
  26.     AppSound = ReadSoundIni();
  27.  
  28.     // get ini-settings for AppButton struct.
  29.     for(i=0;i<MAXAPPS;i++)
  30.     AppButton[i] = ReadButtonIni(i, (LPSTR) INI_BUTTON, (LPSTR) INI_FILE);
  31.  
  32.     AppButtonDefault = InitButton();
  33.  
  34.     // update appbar.ini from earlier version than AppBar 4.0
  35.     if(AppSystem.Initialized < APPBAR4)
  36.     {
  37.     GetPrivateProfileString(INI_SYSTEM, SHELLGROUP, SHELLGROUP_DEFAULT,
  38.                AppSystem.ShellGroup, 4*MAXFILECHARS-1, INI_FILE);
  39.     WritePrivateProfileString(INI_SHELL, SHELLGROUP, AppSystem.ShellGroup, INI_FILE);
  40.     //WritePrivateProfileString(INI_SYSTEM, SHELLGROUP, "not used anymore, see [Shell] section", INI_FILE);
  41.     }
  42.  
  43.     SetCursor(LoadCursor(NULL, IDC_ARROW));
  44.     }
  45.  
  46. /*--------------------------------------------------------------------------*/
  47. /* FUNCTION: IniSave(void)                            */
  48. /*                                        */
  49. /* PURPOSE:  Saves settings to the appbar.ini file.                */
  50. /*--------------------------------------------------------------------------*/
  51. VOID PASCAL IniSave(VOID)
  52.     {
  53.     int i;
  54.  
  55.     SetCursor(LoadCursor(NULL, IDC_WAIT));
  56.     // Save ini-settings from AppButton struct.
  57.     for(i=0;i<MAXAPPS;i++)
  58.     SaveButtonIni(AppButton[i], i, (LPSTR) INI_BUTTON, (LPSTR) INI_FILE);
  59.  
  60.     // Save ini-settings from AppSystem struct.
  61.     SaveSystemIni(AppSystem);
  62.  
  63.     // Save AppSound settings.
  64.     SaveSoundIni(AppSound);
  65.  
  66.     SetCursor(LoadCursor(NULL, IDC_ARROW));
  67.     }
  68.